package com.sugon.dao;

import com.sugon.entity.SpareDevEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 备件设备关联Dao
 *
 * @author sugon
 * @date 2019-07-17 15:19:36
 */
public interface SpareDevDao extends BaseDao<SpareDevEntity> {

    /**
     * 获取匹配的备件-备件替换件ID列表
     * @param map
     * @return
     */
    List<Map<String,Object>> getMatchedSparePartIdList(Map<String, Object> map);

    /**
     * 查看指定备件的已审核通过的替换件ID列表
     * @param spId 备件ID
     * @return
     */
    @Select("SELECT DISTINCT SPARE_ID FROM SPARE_DEV WHERE SPARE_REP_ID = #{spId} AND CHECK_FLAG = 1")
    List<String> queryListThjList(@Param("spId") String spId);

}
